package com.test.sh.service.impl;

import com.test.sh.service.BookShopService;
import com.test.sh.service.Cashier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author liuziyang
 * @create 2018-10-06 17:54
 */
@Service("cashier")
public class CashierImpl implements Cashier {

    @Autowired
    private BookShopService bookShopService;

    @Override
    public void checkout(String username, List<String> isbns) {
        isbns.forEach(s -> {
            bookShopService.purchase(username, s);
        });
    }
}
